/**
 * Created by yihua on 2017/1/22.
 */
$(document).ready(function () {
    var btn = $("#search");
    btn.click(function () {
        var userid = $("#userid").val();
        console.log(userid)
        $.ajax({
            url: '/address/getuseraddress',
            timeout: 100000,
            type: 'get',
            dataType: 'json',
            data: {
                user_id: userid,
                home: true
            },
            success: function (rs) {
                console.log(rs.errno);
                if (rs.errno != 0) {
                    toastr.error(rs.errmsg);
                    return false;
                }
                //console.log(rs.data[0].address)
                $('#addresstable').bootstrapTable('load', rs.data);
                //$('#addresstable').bootstrapTable({
                //data:rs.data
                //});

            },
            error: function () {
                toastr.error('系统错误');
            }
        });
    });


});